# -*- coding: utf-8 -*-

import sys
sys.path.append("./")
from mitmproxy import http
import json
from spider.spider import Spider
spider = Spider()
def request(flow: http.HTTPFlow):
    pass
# response 函数
def response(flow: http.HTTPFlow):
    if "www.toutiao.com/api/pc/feed/?" in flow.request.url:
        res = json.loads(flow.response.text)
        spider.parseJson( res )




